<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="common.*" %>
<%@ page import="java.util.*" %>
<% String contextPath = request.getContextPath(); %>
<%
	Customer cs = (Customer)session.getAttribute("user");
	List<Category> list = Category.category();
	String category = (String)request.getAttribute("cg");
	if(category != null) {
		String c = Category.find_by_code(category);
		category = "カテゴリ　：　" + c; }
	else{ category = ""; }
	String itemname = (String)request.getAttribute("in");
	if(itemname != null) { itemname = "検索名　：　" + itemname; }
	else{ itemname = ""; }

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="css/sidemenu.css" rel="stylesheet" type="text/css">
		<title>サイドメニュー</title>
	</head>
	<body>
		<ul class="sideMenu">
		    <li><a>ようこそ<%= cs.getName() %>さん</a>  
		         <ul id="cn">
		            <li><a href="../customer/customerInfo.jsp">登録情報確認</a></li>
		            <li><a href="../customer/passChange.jsp">パスワード変更</a></li>
		            <li><a href="../index.jsp">ログアウト</a></li>
		         </ul>  
		    </li>  
		    <li><a>商品検索</a>  
		        <ul id="cn">  
		            <li>カテゴリ検索</li>  
		            			<% for( int i = 0; i < list.size(); i++)
				{
					Category c = list.get(i);%>
				<li><a href="../orderCus/ItemListServlet?category=<%= c.getCode() %>"><%= c.getName() %></a></li>
			<% } %>
			</ul>
			<form action="../orderCus/ItemInfoServlet" method="post">
			<ul>
		            <li>商品コード検索</li>  
		            <li><a><input type="text" name="code" /></a></li>
		            <li><a><input type="submit" value="検索" id="serch"/></a></li>
		     </ul>
		     </form>
		     <form action="../orderCus/ItemListServlet" method="post">
		     <ul>
		            <li>商品名検索</li>  
		            <li><a><input type="text" name="itemname"/></a></li>
		            <li><a><input type="submit" value="検索" id="serch"/></a></li>
		            
		    	</ul>
		    	</form>
		    	<form action="<%= contextPath %>/customer/cart.jsp">
			    	<input type="submit" value="カートを見る" />
		    	</form>
			</li>
		</ul>
	</body>
</html>